<?php  echo CHtml::scriptFile('/js/user.js'); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<label for="User_avatar" class="">Avatar <span class="required">*</span></label>
<div style="width:270px;">
<?php
    if(!empty($model->avatar_large)){
         $default_image = $model->avatar_large;
    }else{
         $default_image = '/uploads/avatar/avatar.jpg';
    }
    $this->widget('ext.imageSelect.ImageSelect',  array(
                  'path'=>$default_image,
                  'alt'=>'Upload Image',
                  'text'=>'upload',
                  'uploadUrl'=>'/user/upload',
                  'htmlOptions'=>array()
    ));
 ?>
</div>
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
)); ?>
    
<input type="hidden" value="<?php echo $model->avatar_large; ?>" id="User_avatar_large" name="User[avatar_large]"  class="span3"/>

<?php echo $form->textFieldRow($model,'username',array('class'=>'span3','maxlength'=>20)); ?>

<?php 
     echo $form->passwordFieldRow($model,'password',array('class'=>'span3','maxlength'=>255));
     echo $form->passwordFieldRow($model,'password_repeat',array('class'=>'span3'));
?>

<?php echo $form->textFieldRow($model,'email',array('class'=>'span3','maxlength'=>255)); ?>

<?php if(CCaptcha::checkRequirements()){ ?>
    <?php echo $form->labelEx($model,'verifyCode'); ?>
    <?php $this->widget('CCaptcha'); ?><br><br>
    <?php echo $form->textField($model,'verifyCode'); ?>
    <?php echo $form->error($model,'verifyCode'); ?>
<?php } ?>

<div class="form-actions" style="background: none;border: none;">
        <?php $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType'=>'submit',
                'type'=>'primary',
                'htmlOptions'=>array('id'=>'user_button'),
                'label'=>$model->isNewRecord ? 'Create' : 'Save',
        )); ?>
</div>
<?php $this->endWidget(); ?>